import request from '@/utils/request'

// 区域搜索
export const searchRegionApi = params => request.get('/vm-service/region/search',{
  params
})

// 新增区域
export const addRegionApi = data => request.post('/vm-service/region', data)

// 修改区域
export const editRegionApi = (id, data) => request.put(`/vm-service/region/${id}`, data)

// 删除区域
export const delRegionApi = id => request.delete(`/vm-service/region/${id}`)

// 区域详情
export const getRegionInfoApi = params => request.get('/vm-service/node/search',{
  params
})

// 点位搜索
export const searchNodeApi = params => request.get('/vm-service/node/search',{
  params
})

// 点位详情
export const getNodeInfoApi = id => request.get(`/vm-service/node/vmList/${id}`)

// 新增点位
export const addNodeApi = data => request.post('/vm-service/node', data)

// 修改点位
export const editNodeApi = (id, data) => request.put(`/vm-service/node/${id}`, data)

// 删除区域
export const delNodeApi = id => request.delete(`/vm-service/node/${id}`)

// 获取商圈信息
export const getBusinessTypeApi = () => request.get('/vm-service/businessType')

// 合作商搜索
export const searchPartnerApi = params => request.get('/user-service/partner/search',{
  params
})

// 添加合作商
export const addPartnerApi = data => request.post('/user-service/partner', data)

// 修改合作商
export const editPartnerApi = data => request.put(`/user-service/partner/${data.id}`, data)

// 删除合作商
export const delPartnerApi = id => request.delete(`/user-service/partner/${id}`)

// 重置合作商密码
export const resetPartnerPwdApi = id => request.put(`/user-service/partner/resetPwd/${id}`)